﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace IURIP
{
    /// <summary>
    /// The IMap interface.
    /// </summary>
    public interface IMap
    {
        /// <summary>
        /// Gets the task.
        /// </summary>
        ITask Task { get; }
        /// <summary>
        /// Gets the target.
        /// </summary>
        ITarget Target { get; }
        /// <summary>
        /// Gets the children map items of this map.
        /// </summary>
        List<IMapItem> MapItems { get; }
        /// <summary>
        /// Gets the data blocks thatt used in this map.
        /// </summary>
        List<string> DataBlocks { get; }

        /// <summary>
        /// Initializes the map item with configuration file
        /// </summary>
        /// <param name="node"></param>
        void InitByConfiguration(XmlNode node);
        /// <summary>
        /// Gets map item by its name
        /// </summary>
        /// <param name="name">The map item's name</param>
        /// <returns></returns>
        IMapItem GetMapItemByName(string name);
        /// <summary>
        /// Gets map item by xpath. If the result is a list, this function will return the first one.
        /// </summary>
        /// <param name="xpath">The xpath</param>
        /// <returns></returns>
        IMapItem GetMapItemByXPath(string xpath);
        /// <summary>
        /// Gets map item list by block name
        /// </summary>
        /// <param name="blockName"></param>
        /// <returns></returns>
        List<IMapItem> GetListByBlockName(string blockName);
        /// <summary>
        /// Gets map item list by block name and xpath.
        /// </summary>
        /// <param name="blockName"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        List<IMapItem> GetListByBlockNameAndXPath(string blockName, string xpath);
    }
}
